package com.guigu.gateway.pojo;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

/**
 * @ClassName:User
 * @Description://TODO
 * @Author:taoLong
 * @Date:2021/10/29:16:46 星期五
 * @email:2391611102@qq.com or 2391611102qq@gmail.com
 */
public class UserThread {
    private static User user;

    public static User getUser() {
        if (user == null) {
            synchronized (user) {
                if (user == null) {
                    user = new User("你好");
                }
            }
        }
        return user;
    }
}


@Data
@NoArgsConstructor
@AllArgsConstructor
class User {

    private String name;
}
